package pattern.factory;

public class PizzaStore {
	SimplePizzaFactory factory;

	public PizzaStore(SimplePizzaFactory factory) {
		this.factory = factory;
	}

	public Pizza orderPizza(String type) {
		Pizza pizza = factory.createPizza(type);
		if (pizza == null) {
			System.out.println("There is no this kind of pizza!");
			return null;
		} else {
			pizza.bank();
			pizza.cut();
			pizza.box();
			return pizza;
		}
	}
}
